/**
 *  @file
 *    Sprite is the master class of anything that is drawn on the game board.
 *    This sprite is specific to the Tetris clone
 *    
 *  @author Timon Davis
 *  @date   9/23/2012
 */
package sprite;

import java.awt.Graphics;
import java.awt.Point;

public abstract class Sprite {
	
	private Point point;
	private int width;
	private int height;
	
	public Sprite() {
	
	
	  point = new Point(0,0);
	}
	/**
	 * Draws the sprite
	 * 
	 * @param g
	 *   The graphics object being passed in
	 *   
	 * @return
	 *   The altered Graphics object.
	 */
	abstract public Graphics draw(Graphics g, Point base); // TODO: Does this need to be returnable?
	
	/**
	 * Set the point on the 'tetris' grid
	 * 
	 * @param p
	 *   The point on the 'tetris' grid in which this sprite should preside
	 */
	public void setPoint(Point p) {
		
		this.point = p;
	}
	
	/**
	 * Set the x point on the tetris grid
	 * 
	 * @param x
	 *   The x coord of the sprite on the grid
	 */
	public void setPointX(int x) {
		
	    this.point.x = x;	
	}
	
	/**
	 * Set the y point on the tetris grid
	 * 
	 * @param y
	 *   The y coord of the sprite on the grid
	 */
	public void setPointY(int y) {
		
		this.point.y = y;
	}
	
	/**
	 *  Set the width, in pixels, of this sprite
	 *  
	 *  @param width
	 *    The width, in pixels, of this sprite
	 */
	public void setWidth(int width) { 
		
		this.width = width;
	}
	
	/**
	 *  Set the height, in pixels, of this sprite
	 *  
	 *  @param height
	 *    The height, in pixles, of this sprite
	 */
	public void setHeight(int height) {
		this.height = height;
	}
	
	/**
	 * Reports on the grid point on which this sprite resides
	 * 
	 * @return
	 *   The grid point on which this sprite resides
	 */
	public Point getPoint() {
		
		return point;
	}
	
	/**
	 *  Returns the x coord of the sprite on the tetris grid
	 *  
	 *  @return
	 *    The x coord of the sprite on the tetris grid
	 */
	public int getPointX() {
		
		return this.point.x;
	}
	
	/**
	 *  Returns the y coord of the sprite on the tetris grid
	 *  
	 *  @return
	 *    The y coord of the sprite on the tetris grid
	 */
	public int getPointY() {
		
		return this.point.y;
	}
	
	/**
	 *  Returns width of the sprite, in pixels
	 *  
	 *  @return
	 *    Width of the sprite, in pixels
	 */
	public int getWidth() {
		
		return this.width;
	}
	
	/**
	 * Returns height of the sprite, in pixels
	 * 
	 * @return
	 *   The height of the sprite, in pixels
	 */
	public int getHeight() {
		
		return this.height;
	}
}
